<?php
declare (strict_types = 1);

namespace app\middleware;

class CheckList
{
    /**
     * 处理请求
     *
     * @param \think\Request $request
     * @param \Closure       $next
     * @return Response
     */
    public function handle($request, \Closure $next)
    {
        $data = $request->param();
        if (!isset($data['page'])) {
            exit(re_error('缺少page请求参数'));
        }
        if (!isset($data['limit'])) {
            exit(re_error('缺少limit请求参数'));
        }

        return $next($request);
    }
}
